export default {
    namespaced: true,
    state: () => ({
        loginBindPhonePromiseResolve: null,
        account: {},
        tempAccout: {},
        info: {
            info: {},
        },
    }),
    mutations: {
        SET_LOGIN_BIND_PHONE_PROMISE_RESOLVE(state, resolve) {
            state.loginBindPhonePromiseResolve = resolve;
        },
        SET_TEMP_USER_ACCOUNT(state, tempAccout = {}) {
            state.tempAccout = tempAccout;
        },
        SET_USER_ACCOUNT(state, account = {}) {
            state.account = account;
            uni.setStorageSync("account", account);
        },
        CLEAR_USER_ACCOUNT(state) {
            state.account = {};
            uni.removeStorageSync("account");
            uni.removeStorageSync("userInfo");
        },
        SET_USER_INFO(state, userInfo = {}) {
            state.info = userInfo;
            uni.setStorageSync("userInfo", userInfo);
        },
        CLEAR_USER_INFO(state) {
            state.info = {};
            uni.removeStorageSync("userInfo");
        },
    },
};
